#!/bin/bash

if [[ $# -lt 1 ]]; then
    echo "Usage: $(basename $0) filename"
    exit -1
fi

file=$1

if [ ! -f ${file} ]; then
    echo "${file}: No such file"
    exit -1
fi

# 读取文件
cat ${file} | while read line; do
	# 读取文件中的一行
	echo ${line}
done < ${file}
